package com.sxz.sbs.module.client.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.client.bean.AddUserListBean;
import com.sxz.sbs.module.client.bean.VerifyCodeBean;
import com.sxz.sbs.module.client.view.AddUserAccountView;
import com.sxz.sbs.module.client.view.AddUserListView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 *
 * @author hp
 */
public class AddUserListPresenter extends RxPresenter<AddUserListView> {

    public void getAddUserList (HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getRegisterUserList(map)
                .compose(RxUtil.<AddUserListBean>handleResult())
                .subscribeWith(new RxSubscriber<AddUserListBean>(mView,true){
                    @Override
                    public void onNext(AddUserListBean data) {
                        mView.onGetUserListSuccess(data);
                    }
                })
        );
    }
}
